﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using my.cache;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace webapi.test.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class WeatherForecastController : ControllerBase
    {
        private readonly ILogger<WeatherForecastController> _logger;
        private readonly ICache _cache;
        public WeatherForecastController(ILogger<WeatherForecastController> logger, ICache cache)
        {
            _logger = logger;
            _cache = cache;
        }

        [HttpGet]
        public void Get()
        {
            _cache.SetAsync("test", "1111111");

            Thread.Sleep(10000);

            var aa = _cache.GetAsync("test").GetAwaiter().GetResult();
        }
    }
}
